/*    file: UrlDialog.cpp
 *    desc:
 * 
 * created: 2014-07-01 20:42:57
 *  author: zhengchuanjiang
 * version: 1.0
 * company: 
 */

#include "stdafx.h"
#include "UrlDialog.h"


CUrlDialog::CUrlDialog()
{
}

LRESULT CUrlDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
    SetDlgItemText(IDC_COMBO_URL, m_url);

    m_cmb.Attach(::GetDlgItem(m_hWnd, IDC_COMBO_URL));
    
    if (!m_url.IsEmpty())
    {
        m_cmb.AddString(m_url);
    }
    
    m_cmb.AddString("rtp://localhost:20000?codec=H.264");
    m_cmb.AddString("rtsp://192.168.1.12/");

    return 0;
}

LRESULT CUrlDialog::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
    GetDlgItemText(IDC_COMBO_URL, m_url);

    EndDialog(wID);

    return 0;
}

LRESULT CUrlDialog::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
    EndDialog(wID);

    return 0;
}

CString CUrlDialog::getUrl()
{
    return m_url;
}

void CUrlDialog::setUrl(const CString& url)
{
    m_url = url;
}